def fn1(n):
    for i in range(1,n+1):
        for ii in range(n,0,-1):
            if ii > i :
                print(' '* len(str(ii)),end='')
            else:
                print(ii,end='')
            print(' ',end='')
        print('')

def fn2(n):
    for i in range(n,0,-1):
        for ii in range(n,0,-1):
            if ii > i :
                print(' '* len(str(ii)),end='')
            else:
                print(ii,end='')
            print(' ',end='')
        print('')


fn1(11)
fn2(12)

# 做得不错
